﻿<%@ Page Language="C#" %>
<!DOCTYPE html>
<script runat="server">
    private int page_lang = Utils.GetLangId();
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title><%=Lang.ShowPublic("SystemName")%> </title>
    <link href="../static/css/AdminLogin.css" rel="stylesheet" type="text/css" />
    <link href="../Pulgin/artDialog/skins/idialog.css" rel="stylesheet" />
    <script type="text/javascript" src="../static/js/jquery.js" ></script>
    <script type="text/javascript" src="../Pulgin/artDialog/artDialog.min.js"></script>
    <script type="text/javascript" src="../static/js/Utils.js"></script>
    <script type="text/javascript" src="../static/js/Verification.js"></script>
    <script type="text/javascript" src="../static/lang/<%=page_lang %>.js"></script>
</head>
<body class="body_<%=page_lang %>">
    <div id="Login">
        <h2><%=Lang.ShowPublic("SystemName")%></h2>
        <h3>Development of technology providers : <%=Lang.ShowPublic("SystemName")%> </h3>
        <div class="ch20"></div>
        <div class="inputs lang">
            <select id="Select_Lang">
                <option value="1">选择语言</option>
                <option data-lang-sytle="uy" value="1">Uyghurche</option>
                <option data-lang-sytle="en"  value="101">简体中文</option>
            </select>
        </div>
        <div class="inputs user">
            <input type="text" maxlength="26"  id="Admin_UId"  value="2016"/>
            <div id="Validate-Admin_UId"></div>
        </div>
        <div class="inputs password">
            <input type="password" maxlength="30"  id="Admin_Password"  value="izbolsoft2016"/>
            <div id="Validate-Admin_Password"></div></div>
        <div class="status verification">
            <input id="VerificationImgCode" maxlength="6" type="text" />
            <img id="ImgCode" src="../ajax/VerificationImgCode.ashx" />
        </div>
        <div class="status button">
            <button onclick="Admin_Login()"><%=Lang.Show("Login") %></button>
        </div>
        <div class="help">
            <a target="_blank" href="<%=Lang.ShowPublic("DevelopersWebUrl") %>/home/News-View.aspx?id=94&lang=1"><%=Lang.Show("HelpCenter") %></a></div>
        <div class="system_error" id="System_Error"></div>
    </div>

    <script type="text/javascript">
        /* 初始化语言栏 */
        $("#Select_Lang").val(<%=page_lang%>);

        $("#Select_Lang").change(function () {
            window.location.href = "login.aspx?lang=" + $("#Select_Lang").val();
        })
        function Admin_Login() {
            var admin_id = $("#Admin_UId").val();
            var admin_password = $("#Admin_Password").val();
            var v_code = $("#VerificationImgCode").val();
            var system_lang = $("#Select_Lang").val();
            /* 完整性验证 */
            if(!ValidateLength("Admin_UId",3,8))
                return false;
            if (!ValidateLength("Admin_Password", 8, 25))
                return false;
            if (!ValidateLength("VerificationImgCode", 5, 6))
                return false;
            var ajax_url = "../ajax/Admin.login.ashx";
            var data = { "Admin_UId": admin_id, "Admin_Password": admin_password, "VerificationImgCode": v_code };
            /* 执行AJAX用户信息验证 */
            Ajax_Excute_Full(ajax_url, data, null, null, function (msg) { ShowSuccess(msg, system_lang); }, function (msg) { ShowSuccess(msg, system_lang); }, "System_Error");
        }

        function ShowLaoding() {
            $(".system_error").hide()
            Laoding(true)
        }

        function ShowSuccess(msg, lang) {
            $(".laoding").hide();
            if (msg == "1") {
                $(".complete").slideDown();
                window.location.href = "AdminCenter-layout.Aspx?lang=" + lang;
            }
            else {
                ImgCodeReplace()
                $(".system_error").html(Show_Erorr_Text(msg));
                $(".system_error").slideDown();
            }
        }
        /* 验证码点击更换事件 */
        ImgCodeShow();

            
    </script>


</body>
</html>
